//
// Created by xuchao on 16-11-21.
//

#ifndef OKPG_OKPGURL_H
#define OKPG_OKPGURL_H

#include <iostream>

#define DEFAULT_PROTOCOL "postgresql"
#define DEFAULT_HOST "127.0.0.1"
#define DEFAULT_PORT 5432
namespace OKPg {

    class OkPgUrl {
    private:
        std::string protocol_;
        std::string host_;
        u_int port_;
        std::string dbName_;
        std::string user_;
        std::string password_;

    public:
        OkPgUrl(
                const std::string &dbName,
                const std::string &user,
                const std::string &password,
                const std::string &host = DEFAULT_HOST,
                u_int port = DEFAULT_PORT,
                const std::string &protocol = DEFAULT_PROTOCOL);

        std::string toString() const;
    };
}


#endif //OKPG_OKPGURL_H
